CC = gcc -g
AR = ar

LDHDPATH = -I ../include -I ../tsmp
LDLIBS = -lsim -lcomp_api
LIBSRC = ./src/

libopensync.a:
	$(CC) -o $(LIBSRC)pkt_recv_send_api.o -c $(LIBSRC)pkt_recv_send_api.c $(LDLIBS) $(LDHDPATH)
	$(CC) -o $(LIBSRC)shadow_clock.o -c $(LIBSRC)shadow_clock.c
	$(CC) -o $(LIBSRC)tools.o -c $(LIBSRC)tools.c $(LDLIBS) $(LDHDPATH)
	$(CC) -o $(LIBSRC)clock_config.o -c $(LIBSRC)clock_config.c
	$(CC) -o $(LIBSRC)header_generate.o -c $(LIBSRC)header_generate.c
	$(CC) -o $(LIBSRC)header_parse.o -c $(LIBSRC)header_parse.c
	$(AR) -rc libopensync.a $(LIBSRC)pkt_recv_send_api.o $(LIBSRC)shadow_clock.o $(LIBSRC)tools.o $(LIBSRC)clock_config.o $(LIBSRC)header_generate.o $(LIBSRC)header_parse.o

clean:
	rm -rf $(LIBSRC)*.o ./libopensync.a
